# coding:utf-8

l = ['dewei', 'xiaomu', 'xiaoman', 'xiaoming']

for i in l:
    print(i)

for i in 'python':
    print(i)

users = ('dewei', 'gxx', 'xiaomu', 'xiaoming')

for name in users:
    print(name)

users = {'name': 'dewei', 'age': 33}

for i in users:
    print(i, users[i])

"""
items()
返回由字典项 ((键, 值) 对) 组成的一个新视图。
"""
items = users.items()
print(items)  # dict_items([('name', 'dewei'), ('age', 33)])

for key, value in users.items():
    print(key, value)  # name dewei  age 33

users_list = [
    {'username': 'dewei'},
    {'username': 'xiaomu'}
]

for user in users_list:
    print(user.get('username'))
    print(user.get('age'))

"""
range 类型表示不可变的数字序列，通常用于在 for 循环中循环指定的次数。
"""
l = range(6)
print(l, type(l))  # range(0, 6) <class 'range'>

for i in l:
    print(i)
else:
    print('for循环结束了')
